package com.example.community.entity;

import jdk.nashorn.internal.ir.annotations.Ignore;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: huang
 * @Date: 2021/10/4 11:27
 * @Description:
 */
public class Event {

    private String topic;  //表示event类型(评论\点赞\关注)
    private int userId;      //表示执行event的用户id
    private int entityType;  //entityType 与 entityId 确定了该topic 的Entity对象(帖子\回复\用户)
    private int entityId;
    private int entityUserId;  //Entity对象的useId
    private Map<String, Object> data = new HashMap<>(); //map 用来存放一些补充数据，比如时间

    public String getTopic() {
        return topic;
    }

    public Event setTopic(String topic) {
        this.topic = topic;
        return this;
    }

    public int getUserId() {
        return userId;
    }

    public Event setUserId(int userId) {
        this.userId = userId;
        return this;
    }

    public int getEntityType() {
        return entityType;
    }

    public Event setEntityType(int entityType) {
        this.entityType = entityType;
        return this;
    }

    public int getEntityId() {
        return entityId;
    }

    public Event setEntityId(int entityId) {
        this.entityId = entityId;
        return this;
    }

    public int getEntityUserId() {
        return entityUserId;
    }

    public Event setEntityUserId(int entityUserId) {
        this.entityUserId = entityUserId;
        return this;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public Event setData(String key, Object value) {
        this.data.put(key, value);
        return this;
    }



}
